import logger from 'electron-log'
import {app} from 'electron'
const path = require("path");
 
logger.transports.file.level = 'debug'
logger.transports.file.maxSize = 1002430 // 10M
logger.transports.file.format = '[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}]{scope} {text}'
let date = new Date()
date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()

logger.transports.file.resolvePath = () =>  path.join('D:\\', date + '.log')
logger.transports.file.resolvePath = () =>  path.join('C:\\Users\Administrator\AppData\Roaming\Electron', date + '.log')
 
export default {
  info (param) {
    logger.info(param)
  },                   
  warn (param) {
    logger.warn(param)
  },
  error (param) {
    logger.error(param)
  },
  debug (param) {
    logger.debug(param) 
  },
  verbose (param) {
    logger.verbose(param)
  },
  silly (param) {
    logger.silly(param)
  }
}